package string;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/2/28
 **/
public class IndexOfDemo {
    public static void main(String[] args) {
        String str="thinking in katharsis";
        int index=str.indexOf("in");
        System.out.println(index);

        index =str.indexOf("in",3);
        System.out.println(index);
        index =str.indexOf("abc");
        System.out.println(index);
        index=str.lastIndexOf("in");
        System.out.println(index);
    }
}
/*
        String str="thinking in kathrasis";
        int index=str.indexOf("in");
        System.out.println(index);
        index =str.indexOf("in",3);
        System.out.println(index);
        index=str.indexOf("abc");
        System.out.println(index);
        index=str.lastIndexOf("in");
        System.out.println(index);
 */
